<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>TBrowse: Dictyostelium RNA-seq</title>
	<meta http-equiv="Pragma" content="no-cache">

    <meta http-equiv="expires" content="-1">

	<!--[if IE]><script type="text/javascript" src="ext_extensions/canvas/excanvas.compiled.js"></script><![endif]-->
	<script type="text/javascript" src="ext_extensions/canvas/canvas.text.js"></script>
	<!-- STYLES -->
	<link rel="stylesheet" type="text/css" href="ext-3.0.0/css/ext-all.css">
	<link rel="stylesheet" type="text/css" href="ext_extensions/SuperBoxSelect.css">
	
	<style type="text/css">
		.help_text p{
			margin-top:5px;
			margin-bottom:7px;
		}
	</style>

    

    <script language="javascript" type='text/javascript' src='plot/jquery.js'></script> 
    <script language="javascript" type='text/javascript' src='plot/ext-jquery-adapter.js'></script> 
	<script type="text/javascript" src="ext-3.0.0/ext-base.js"></script>
	<script type="text/javascript" src="ext-3.0.0/ext-all.js"></script>
	<script type="text/javascript" src="ext_extensions/ext-basex-svn.js"></script>

	<!--
		<script type="text/javascript" src="ext-3.0.0/ext-all-debug.js"></script>

	-->
    
    <script language="javascript" type="text/javascript" src="plot/jquery.flot.trunk.pie.js"></script> 
	<link rel='stylesheet' type='text/css' href='plot/Flot.css' /> 
    <script language="javascript" type="text/javascript" src="plot/Flot.js"></script> 
    <script language="javascript" type="text/javascript" src="plot/BarFlot.js"></script> 
	<script type="text/javascript" src="ext_extensions/RowLayout.js"></script>
	<script type="text/javascript" src="ext_extensions/SuperBoxSelect.js"></script>
	<script type="text/javascript" src="ext_extensions/grid.inc.js"></script>

	<!-- tbrowse -->  
	<script type="text/javascript" src="js/plot.js"></script>
	<script type="text/javascript" src="js/browser.js"></script>
	<script type="text/javascript" src="js/config.js"></script>
	<script type="text/javascript" src="js/functions.js"></script>
	<script type="text/javascript" src="js/canvas.js"></script>
	<script type="text/javascript" src="js/samples.js"></script>
	<script type="text/javascript" src="js/layout.js"></script>
	

    <script type="text/javascript">
		Ext.lib.Ajax.maxConcurrentRequests = 1;
		Ext.onReady(function(){
		
			Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
            
            if(Ext.isIE) {
                    Ext.Msg.alert('Internet Explorer Sucks!', 
                    'Internet Explorer is very slow and will have problems showing this site. <br>Use <a target="_blank" href="http://www.mozilla.com/firefox/"> Firefox</a>, <a target="_blank" href="http://www.apple.com/safari/">Safari</a> or <a target="_blank" href="http://www.google.com/chrome"> Chrome</a>.');
            }
			layout();
			GETparams = Ext.urlDecode(location.search.substring(1));
			for(i in GETparams) {
				if(i == 'query') {
					Ext.getDom('query').value = GETparams.query;
                    sampleGrid.getView().on('refresh', 
                    function() { get_locations(Ext.getDom('query').value,search_mask,true);},this,
                    {single: true}
                    )
				}
				else if(i == 'genome') {
					current_genome = GETparams[i];
				}
				else if(i =='selectedTracks') {
					sampleGrid.selected_tracks = GETparams.selectedTracks.split(',')
				}
	            else if (i != '' & GETparams[i] != undefined) {
					eval(i + '="' + GETparams[i] + '"');
				}
			}
			Ext.getCmp('genome').setValue(Ext.getCmp(current_genome), true)

            if(Ext.util.Cookies.get("hasVisited") == undefined) {
                var win = new Ext.Window({
                    title: "First visit to tbrowse",
                    id: 'firstVisit',
                    ctCls: 'myPopup',
                    closable: true,
                    layout: 'anchor',
                    autoHeight: true,
                    autoWidth: true,
                    stateful: false,
                    plain: true,
                    html: 'To get started with tbrowse you can watch a brief <a href="#" id="tutorial2">Tutorial</a>. <br>OR<br><a href="index.html?genome=dd&query=4:1953697..1963012&selectedTracks=144,139,146,138">Click here</a> to poplute tbrowse with a region of Chromosome 4.<br>OR<br>Close this window and use the search panel to start viewing your own regions of interest.'
                });
                win.show(this);
                Ext.get('tutorial2').on('click',
                function() {
                    if (Ext.getCmp('tutorialPopout'))
                    { 
                        if(Ext.getCmp('tutorialPopout').isVisible()) {
                            Ext.getCmp('tutorialPopout').destroy()
                            return;
                        }
                        else {
                            Ext.getCmp('tutorialPopout').destroy()
                        }
                    }
                    var win = new Ext.Window({
                        title: "Tutorial",
                        id: 'tutorialPopout',
                        ctCls: 'myPopup',
                        closable: true,
                        layout: 'anchor',
                        width: 660,
                        height: 540,
                        stateful: false,
                        plain: true,
                        html: '<object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/I4QoPGFk4x0&hl=en_US&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6&hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/I4QoPGFk4x0&hl=en_US&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6&hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object>'
                    });
                    win.show(this);

                });

                urlInfo = parse_url(document.URL)

                Ext.util.Cookies.set("hasVisited", 'true',
                new Date(new Date().getTime()+(1000*60*60*24*30)),
                urlInfo.path);
            
            }
            
		});	
    </script>
</head>
<body>
</body>
</html>